<template>
  <div>
    <Card class="marginB10">
      <div slot="title">
        <span class="pointer" @click="other_tool_show=!other_tool_show" >
          其他
          <Icon :type="other_tool_show?'md-arrow-dropup':'md-arrow-dropdown'" class="cBlue" size="24" />
          <span class="cRed">（非必填项，点击可查看选项信息）</span>
        </span>
      </div>
      <div v-show="other_tool_show">
        <div class="overflowH f_14 TJ_big">
          <div class="TJ_title f_bold f_16 visHidden">-</div>
          <div class="TJ_box paddingB20">
            <div class="f_16 f_bold marginB15">代表人为非第一署名申请人时声明</div>
            <div style="padding-left:80px;">
              特声明第
              <Input size="large" 
                placeholder="请输入数字" type="number" 
                onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" 
                style="width:200px;margin:0 10px;" clearable v-model="main_applicant" 
                ref="main_applicant"
              />署名申请人为代表人
            </div>
          </div>
        </div>
        <div class="overflowH f_14 TJ_big">
          <div class="TJ_title f_bold f_16 visHidden">-</div>
          <div class="TJ_box paddingB10">
            <div class="f_16 f_bold marginB15">分案申请</div>
            <div class="marginB10">
              <span class="inlineBlock textRight paddingR10" style="width:150px;">原申请号：</span>
              <Input placeholder="请输入原申请号" size="large" class="SQ_One_R" clearable  v-model="div_app_number" ref="div_app_number"/>
            </div>
            <div class="marginB10">
              <span class="inlineBlock textRight paddingR10" style="width:150px;">原申请日期：</span>
              <DatePicker 
                v-model="div_app_date"
                ref="div_app_date"
                format="yyyy-MM-dd"
                :options="optMax"
                type="date" 
                placeholder="请选择日期" 
                size="large"
                class="SQ_One_R marginR10"
                :editable="false"
                :clearable="false"
                @on-change="ondEndJ()"
              ></DatePicker>
              <Icon
                v-show="div_app_date"
                type="md-close-circle"
                class="cCCC pointer  relative"
                style="top:2px;"
                size="18"
                @click="div_app_date=''"
              />
            </div>
            <div class="marginB10">
              <span class="inlineBlock textRight paddingR10" style="width:150px;">针对的分案申请号：</span>
              <Input placeholder="请输入针对的分案申请号" size="large" class="SQ_One_R" clearable v-model="case_div_app_number" ref="case_div_app_number" />
            </div>
          </div>
        </div>

        <!-- 发明 -->
        <template  v-if="type==2">
          <div class="overflowH f_14 TJ_big">
            <div class="TJ_title f_bold f_16 visHidden">-</div>
            <div class="TJ_box paddingB10">
              <div class="f_16 f_bold marginB15">生物材料样品</div>
              <div class="marginB15">
                <span class="inlineBlock textRight paddingR10" style="width:150px;">保藏单位代码：</span>
                <Input placeholder="请输入保藏单位代码" size="large" class="SQ_One_R" clearable v-model="preserve_data.preserve_unit_code"  />
              </div>
              <div class="marginB15">
                <span class="inlineBlock textRight paddingR10" style="width:150px;">地址：</span>
                <Input placeholder="地址" size="large" class="SQ_One_R" clearable  v-model="preserve_data.preserve_address"/>
              </div>
              <div class="marginB15">
                <span class="inlineBlock textRight paddingR10" style="width:150px;">保藏日期：</span>
                <DatePicker 
                  v-model="preserve_data.preserve_date"
                  ref="preserve_date"
                  format="yyyy-MM-dd"
                  :options="optMax"
                  type="date" 
                  placeholder="请选择日期" 
                  size="large"
                  class="SQ_One_R marginR10"
                  :editable="false"
                  :clearable="false"
                  @on-change="ondEndA()"
                ></DatePicker>
                <Icon
                  v-show="preserve_data.preserve_date"
                  type="md-close-circle"
                  class="cCCC pointer  relative"
                  style="top:2px;"
                  size="18"
                  @click="preserve_data.preserve_date=''"
                />
                <!-- <Input placeholder="请输入保藏日期（年-月-日）" size="large" class="SQ_One_R" clearable v-model="preserve_data.preserve_date"/> -->

              </div>
              <div class="marginB15">
                <span class="inlineBlock textRight paddingR10" style="width:150px;">保藏编号：</span>
                <Input placeholder="请输入保藏编号" size="large" class="SQ_One_R" clearable  v-model="preserve_data.preserve_number"/>
              </div>
              <div class="marginB15">
                <span class="inlineBlock textRight paddingR10" style="width:150px;">分类命名：</span>
                <Input placeholder="请输入分类命名" size="large" class="SQ_One_R" clearable v-model="preserve_data.preserve_type_name"/>
              </div>
              <div style="padding-left:130px;" class="marginB15">
                <Checkbox size="large" class="paddingR10" v-model="preserve_data.preserve_is_life">是否存活</Checkbox>
              </div>
            </div>
          </div>
          <div class="overflowH f_14 TJ_big">
            <div class="TJ_title f_bold f_16 visHidden">-</div>
            <div class="TJ_box paddingB10">
              <div class="f_16 f_bold marginB15">序列表</div>
              <div class="marginB15" style="padding-left:130px;">
                <Checkbox size="large" class="paddingR10" v-model="preserve_is_dna">本专利申请涉及核苷酸或氨基酸序列表</Checkbox>
              </div>
            </div>
          </div>
          <div class="overflowH f_14 TJ_big">
            <div class="TJ_title f_bold f_16 visHidden">-</div>
            <div class="TJ_box paddingB10">
              <div class="f_16 f_bold marginB15">遗传资源</div>
              <div class="marginB15" style="padding-left:130px;">
                <Checkbox size="large" class="paddingR10" v-model="preserve_is_genetic">本专利申请涉及的发明创造是依赖于遗传资源完成的</Checkbox>
              </div>
            </div>
          </div>
        </template>

        <div class="overflowH f_14 TJ_big">
          <div class="TJ_title f_bold f_16 visHidden">-</div>
          <!-- 优先权 -->
          <PDList ref="PDList"  />
        </div>
            
          
        <div class="overflowH f_14 TJ_big">
          <div class="TJ_title f_bold f_16 visHidden">-</div>
          <div class="TJ_box paddingB10">
            <div class="f_16 f_bold marginB15">不丧失新颖性宽限期声明</div>
            <div style="padding-left:130px;">
              <div class="marginB15">
                <Checkbox size="large" class="paddingR10" v-model="other_one">已在中国政府主办或承认的国际展览会上首次展出</Checkbox>
              </div>
              <div class="marginB15">
                <Checkbox size="large" class="paddingR10" v-model="other_two">已在规定的学术会议或技术会议上首次发布</Checkbox>
              </div>
              <div class="marginB15">
                <Checkbox size="large" class="paddingR10" v-model="other_three">他人未经申请人同意而泄露其内容</Checkbox>
              </div>
            </div>
          </div>
        </div>

        <!-- 外观设计 -->
        <template v-if="type==1">
          <div class="overflowH f_14 TJ_big">
            <div class="TJ_title f_bold f_16 visHidden">-</div>
            <div class="TJ_box paddingB10 ">
              <div class="marginB30">
                <div class="f_16 f_bold marginB15">相似设计</div>
                本案为同一产品的相似外观设计,其所包含的项数为
                <Input  size="large" placeholder="请输入数字" type="number"
                onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" style="width:200px;margin:0 10px;" clearable v-model="similar_design" ref="similar_design" />项
              </div>
            </div>
          </div>
          <div class="overflowH f_14 TJ_big">
            <div class="TJ_title f_bold f_16 visHidden">-</div>
            <div class="TJ_box paddingB10">
              <div class="f_16 f_bold marginB15">成套产品</div>
              <div class="marginB20">
                本案为成套产品的多项外观设计,其所包含的项数为
                <Input  size="large" placeholder="请输入数字" type="number"
                onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" style="width:200px;margin:0 10px;" clearable v-model="complete_product" ref="complete_product" />项
              </div>
              
            </div>
          </div>
        </template>

      </div>
      
      <div class="c999">
        <Divider orientation="left" class="marginT5 f_16">温馨提示：</Divider>
        <div class="lineH2">
        （1）如需请求费减，下单前请自行办理费减并确认备案合格，系统默认请求费减，如无需费减则不勾选；<br/>
        （2）系统24小时均可自助下单，下单后一个工作日内自动提交至专利局；<br/>
        （3）发明与实新同日申请，需分开下单，并在两个订单中都勾选“同日申请”；<br/>
        （4）请自行确认订单信息、文件内容是否正确（外观图片是否符合专利局要求），系统不作人为审核；<br/>
        （5）专利代理委托书需包含专利名、代理人、日期等信息，并有申请人签字/盖章；<br/>
        （6）官方来文，邮件自动消息提醒，请及时处理；<br/>
        （7）官方文件系统自动下发，可在订单中心-专利订单中查看及下载；<br/>
        （8）通知书下发时间具体以专利局时间为准，受理通知书下发时间一般为提交后的2个工作日左右，最长为15个工作日。
        </div>
      </div>
    </Card>
  </div>
</template>



<script>
import PDList from "./patentOtherCom/pDList";
export default {
  name: "other",
  data() {
    let data = {
      main_applicant:'',//特声明第

      //分案申请
      div_app_number:'',//原申请号
      div_app_date:'',//原申请日期
      case_div_app_number:'',//针对的分案申请号

      

      // DNA xxx那串东西
      preserve_data:{
        preserve_unit_code:'',// 保藏单位代码,
        preserve_address:'',// 保藏地址,
        preserve_date:'',// 日期 2019-7-24,
        preserve_number:'',// 保藏编号,
        preserve_type_name:'',// 分类命名,
        preserve_is_life:false//是否存活
      },
      preserve_is_dna:false,//序列表
      preserve_is_genetic:false,//遗传资源


      similar_design:'',
      complete_product:'',

      other_one:false,
      other_two:false,
      other_three:false
    };

    let tool={
      other_tool_show: false,//手风琴框
      optMax: {
        disabledDate(date) {
          let out = date && date.valueOf() > Date.now();
          return out;
        }
      }
    };
    return Object.assign(data, tool);
  },
  //0实用新型、1外观设计、2发明
  props:['type'],
  components: {PDList},
  mounted() {
  },
  methods: {
    // 格式化时间戳 再赋值
    ondEndJ(){
      let{
        div_app_date
      }=this;

      if(typeof div_app_date === 'object'){
        let date=$app.formatTime(2, ((div_app_date).valueOf()/1000) );
        this.div_app_date=date;// 转成日期格式，例子： 2020-03-23
        //console.log(this.div_app_date)
      }
      
      
    },
    // 格式化时间戳 再赋值
    ondEndA(){
      let{
        preserve_data:{
          preserve_date
        }
      }=this;

      if(typeof preserve_date === 'object'){
        let date=$app.formatTime(2, ((preserve_date).valueOf()/1000) );
        this.preserve_data.preserve_date=date;// 转成日期格式，例子： 2020-03-23
      }
    },
  }
};
</script>

